#!/bin/bash


imageName="inthbl/test_http_server"


startContainer(){
    if [ $(docker ps -a -f "name=^$containerName$" | wc -l) -gt 1 ];then
        docker start $containerName
    else
        portArgs=""
        for i in $ports;do
            portArgs="$portArgs -p $i:$i"
        done
        
        docker run -d --name="$containerName"  \
            $portArgs \
            $imageName $ports
    fi

}

# gitea
containerName="git.lan"
ports="3000"
startContainer

# seafile
containerName="seafile.server.lan"
ports="8080 8082 8000"
startContainer

# bitwarden
containerName="bitwarden.server.lan"
ports="9000"
startContainer

# serverlan
containerName="server.lan"
ports="6800"
startContainer
